<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        font-size: 30px;
    }

    button {
        width: 300px;
        height: 200px;
        font-size: 40px;
    }
</style>

<body>
    <button>抽一下看看</button>
    <p></p>
</body>
<script>
    const btn = document.querySelector("button");
    const p = document.querySelector("p");
    btn.addEventListener("click", function () {
        p.innerText = get();
    })
    function get() {
        const num =randomRange(0,3);
        console.log(num);
        if (num === 0) {
            return "你是个煞笔"
        } else if (num === 1) {
            return "看来你很聪明啊"
        } else {
            return "你难道是张渝洛？"

        }
    }
    function randomRange(min, max) { // min最小值，max最大值

        return Math.floor(Math.random() * (max - min)) + min;

    }
</script>

</html>